{% extends "index.html" %}
{% block title %}
    作者列表
{% endblock %}
{% block nav-list %}
    <a href="/" class="list-group-item list-group-item-action">首页</a>
    <a href="/book/list" class="list-group-item list-group-item-action">图书列表</a>
    <a href="/author/list" class="list-group-item list-group-item-action border-info bg-info text-white">作者列表</a>
    <a href="/publish/list" class="list-group-item list-group-item-action">出版社列表</a>
    <a class="list-group-item list-group-item-action disabled">更多</a>
{% endblock %}
{% block content-title %}
    图书列表
{% endblock %}
{% block content %}
    <table class="table table-striped table-hover">
        <thead>
        <td>ID</td>
        <td>姓名</td>
        <td>性别</td>
        <td>年龄</td>
        <td>电话</td>
        <td>地址</td>
        <td>操作</td>
        </thead>
        <tbody>
        {% for author in author_queryset %}
            <tr>
                <td>{{ author.pk }}</td>
                <td>{{ author.name }}</td>
                <td>{{ author.get_gender_display }}</td>
                <td>{{ author.author_detail.age }}</td>
                <td>{{ author.author_detail.phone }}</td>
                <td>{{ author.author_detail.address }}</td>
                <td>
                    <a class="btn btn-info" href="/author/add">添加</a>
                    <a class=" btn btn-secondary" href="/author/modify/?author_id={{ author.pk }}">修改</a>
                    <a class="btn btn-danger" href="/author/delete/?author_id={{ author.pk }}">删除</a>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
{% endblock %}